//
//  WeexCNV.m
//  MyWeeX
//
//  Created by 仓鼠_Z on 2018/11/21.
//  Copyright © 2018 LeHe. All rights reserved.
//

#import "WeexCNV.h"
#import <WeexSDK/WXConvert.h>
@interface WeexCNV ()

//@property (nonatomic, strong) NSMutableArray * arr;
//@property (nonatomic, strong)  NSMutableDictionary * dict ;


@end

@implementation WeexCNV

- (instancetype)initWithRef:(NSString *)ref
                       type:(NSString*)type
                     styles:(NSDictionary *)styles
                 attributes:(NSDictionary *)attributes
                     events:(NSArray *)events
               weexInstance:(WXSDKInstance *)weexInstance{
    
    
    if(self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) {
        
        if ([attributes allKeys]){
            NSLog(@"%@",attributes);
            _age = (int) [WXConvert NSInteger: attributes[@"age"]];
            _name  = [WXConvert NSString: attributes[@"name"]];
        }
        
    }
    return self ;
}

- (void)viewDidLoad {
    self.age = 100;
    [self fireEvent:@"osfire" params:@{@"123":@"123"}];
 }

-(void)updateAttributes:(NSDictionary *)attributes{
    NSLog(@"%@",attributes);
    _age = (int) [WXConvert NSInteger: attributes[@"age"]];

}

@end
